package cn.acmenms.utils;

import org.springframework.context.ApplicationContext;

/**
 * @ClassName: SpringContextUtils
 * @Description: 提供捕获Spring ApplicationContext容器的工具类
 * @author: 神奇的鸭鸭
 * @Date: 2017/12/6 13:57
 */
public class SpringContextUtils {

    private static ApplicationContext context = null;

    public static void setContext(ApplicationContext applicationContext) {
        SpringContextUtils.context = applicationContext;
    }

    public static Object getBean(String name) {
        return context.getBean(name);
    }
}